UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FYy0Xyfo3rWk0DmM2BTK5XF7VJs60yI/a4AqkTyGAx0=' 
WHERE 
  key_id = '6e747b0c125322b5cfafd72eaf0e36bca27c00375b1274eb7d3caac5569b6935' 
  AND (
    token = 'FYy0Xyfo3rWk0DmM2BTK5XF7VJs60yI/a4AqkTyGAx0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031