UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CHktSPBoDnIcDETNWoJpkPDIoobDNoO1TmKn3css7Xg=' 
WHERE 
  key_id = 'eb5d1d9da5380cdd57f4f30e5dde5d2845a3d038eb2dfc22fa1321079a3e43a0' 
  AND (
    token = 'CHktSPBoDnIcDETNWoJpkPDIoobDNoO1TmKn3css7Xg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035