UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IaQ7bXLxVJIkxuYaW/Efk9lLfsPaNVqYop9uTqWtrD0=' 
WHERE 
  key_id = '8ba124da12907f0408150b0dbbf25dd6eb2d8ce9e23c54b3c16a2b7dc575c625' 
  AND (
    token = 'IaQ7bXLxVJIkxuYaW/Efk9lLfsPaNVqYop9uTqWtrD0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027