UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OkVjBOoTRN0cvzFrKP7bJgY1PvhyMbruYx2D/IJnlsw=' 
WHERE 
  key_id = '55acc130e7ca58b109f5929ea3b4e1d106d0558a8b0d7e37cefb25c7dd7c8945' 
  AND (
    token = 'OkVjBOoTRN0cvzFrKP7bJgY1PvhyMbruYx2D/IJnlsw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045