UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ooZTrt2UmIKdQ0mDanUxoNNqk4efcsF7M02ODWs2JP0=' 
WHERE 
  key_id = '3cf5dee68a1340eaf428aae518fac5b5036ef599be0cfc096d26f8409531f5a5' 
  AND (
    token = 'ooZTrt2UmIKdQ0mDanUxoNNqk4efcsF7M02ODWs2JP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022