UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sPM5dOTxeAfGqHu0vbpMAYQzFDPTN6EdxfTTbFqoa/E=' 
WHERE 
  key_id = '30661609984c17de8d025e6d1239a12e19caea888ce623a0edd0c1e83af2fe65' 
  AND (
    token = 'sPM5dOTxeAfGqHu0vbpMAYQzFDPTN6EdxfTTbFqoa/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048