UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ru1hXrxZQvVQYprPxQPnFDpVrP/M+GJksXEwF/zMPZg=' 
WHERE 
  key_id = 'ef6fe79e6d6a7271126e05845993ef3841858c565cf400efdd4e73d8d6eab2cb' 
  AND (
    token = 'Ru1hXrxZQvVQYprPxQPnFDpVrP/M+GJksXEwF/zMPZg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051