UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KQZGQ6MHFTDW8opoaaSqIaFHNGDXTPQPoNoQzoqBkv8=' 
WHERE 
  key_id = '8a0b5fb4caa81b8d6aee642c1bf210fd817c30d494590d83e2c2a20994907c91' 
  AND (
    token = 'KQZGQ6MHFTDW8opoaaSqIaFHNGDXTPQPoNoQzoqBkv8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044