UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RNFrNkvnGOnEVYivbJc2javH3v3M6TiO12rG+jg2Etc=' 
WHERE 
  key_id = '863ae0b2f5c5b9ae954528e7f3516372212176b9cc50b74f13d0dc46f94f3c0c' 
  AND (
    token = 'RNFrNkvnGOnEVYivbJc2javH3v3M6TiO12rG+jg2Etc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020