UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JCT9qxzSSJafZzw5TcZwr0WZ4BFApIFDSJB2xAzUAFs=' 
WHERE 
  key_id = '72e0c637a94a8320de522f6eb15c13bf8eaea9e3f2ca5b420ef1d96292adf7a4' 
  AND (
    token = 'JCT9qxzSSJafZzw5TcZwr0WZ4BFApIFDSJB2xAzUAFs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031