UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4rTcAiz1urreCAoB6ZgG7ui9jNFKyB/tIWSf2z0ECl8=' 
WHERE 
  key_id = '4b57f3dee08591ee08fc213fcaec641f64c5a9a79e86d6a1e0e1608397f868ef' 
  AND (
    token = '4rTcAiz1urreCAoB6ZgG7ui9jNFKyB/tIWSf2z0ECl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019