UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AkYvUo99Y8QWS6AP+JqL6qMlEk/X3Tq6nhrgf8mBHL0=' 
WHERE 
  key_id = 'f352a4bcd71312ca7b2bd63e56a3dae7bdea55debdcaf0bf5d0336b036392a45' 
  AND (
    token = 'AkYvUo99Y8QWS6AP+JqL6qMlEk/X3Tq6nhrgf8mBHL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041