UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oOM6dAx7Oo/EWlh+c1ODiy7q+FzQmfLaDsoPvJMokRA=' 
WHERE 
  key_id = 'aaa9151d40774c308b2e620ca7c91b7d5243ba2756a884b00db2403a7c7cfb16' 
  AND (
    token = 'oOM6dAx7Oo/EWlh+c1ODiy7q+FzQmfLaDsoPvJMokRA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040