UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DT/zAUwVbTG/lj2PKL7pN9gZoovMWJOrLZEgBXtNGdI=' 
WHERE 
  key_id = '7e8ccc5aec03bfc98b3aea8f7c9c0b657d7a0152180fc37388b9821e31bb7bd3' 
  AND (
    token = 'DT/zAUwVbTG/lj2PKL7pN9gZoovMWJOrLZEgBXtNGdI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030