UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UeUMPdRvSMguQgRd5TPUHGElQcWth11vZoc4oOv+pCc=' 
WHERE 
  key_id = 'b356f04ebdae9b3fd6ebf06fbf7053e8d36c64a83554423f5520d0d15490de3e' 
  AND (
    token = 'UeUMPdRvSMguQgRd5TPUHGElQcWth11vZoc4oOv+pCc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031