UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kKVGw/DZ5ekwxeR10vgDR9hjqJ5rE6dzjswvmRqwQLE=' 
WHERE 
  key_id = '64ec818422569a3c4dde236b4e538754b3cd4baddadcb01fc1c947fde6ad43a4' 
  AND (
    token = 'kKVGw/DZ5ekwxeR10vgDR9hjqJ5rE6dzjswvmRqwQLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030