UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jNK1usbjTjyRs4fQ5LwVdRt5xlxcjTlworeUDcJk0uY=' 
WHERE 
  key_id = '9cfdd87120883f3e7631504e50952cd3513282ff3209d300d05f8a1e7c280e87' 
  AND (
    token = 'jNK1usbjTjyRs4fQ5LwVdRt5xlxcjTlworeUDcJk0uY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043