UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BNVxElIpuYcxvIX2eNINc0A6lZVPdfuRGTj/wBpg+i4=' 
WHERE 
  key_id = '9187a2a3114849acbaa98bcb73b9acf9a4c28a64d7a0332e5a8be1e8c4407248' 
  AND (
    token = 'BNVxElIpuYcxvIX2eNINc0A6lZVPdfuRGTj/wBpg+i4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036