UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VGmsdGW50o0m+1iPTHPnIks6VrNyxb/vm8tJljUNHnY=' 
WHERE 
  key_id = '1e332e00d2ff48eef4ccb52e4abebeb5a03393a09d158586ae260f664bf89bef' 
  AND (
    token = 'VGmsdGW50o0m+1iPTHPnIks6VrNyxb/vm8tJljUNHnY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043