UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SdBbKJS91h4Rq+nojL3OTGkPMYuRxj00oEu3lq7xZ6Q=' 
WHERE 
  key_id = '49c3510d099ddccca79ba5fd960a3134d030a0acc6d26d757e675bce5e685ad0' 
  AND (
    token = 'SdBbKJS91h4Rq+nojL3OTGkPMYuRxj00oEu3lq7xZ6Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036