UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0nkn/BC2Nl3pjKjLLgnFj6b8ybu1vtM/1KcVjiVbzeo=' 
WHERE 
  key_id = '9787fd4851bf6c165f843a36baeeefec41273360cc99bb4e3962dce8bbccd65b' 
  AND (
    token = '0nkn/BC2Nl3pjKjLLgnFj6b8ybu1vtM/1KcVjiVbzeo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048