UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HHxdhr1GGkM9GC2VhTOyusZ7wfRDUrc5bAQ0rJsAC/g=' 
WHERE 
  key_id = '2f5b36f3fa2ac5203430b4ed67b538e13cda58a03cdb54d24fe3f498fbff6d64' 
  AND (
    token = 'HHxdhr1GGkM9GC2VhTOyusZ7wfRDUrc5bAQ0rJsAC/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034