UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zBplZx3FzdUjtJM9s+b7LUVqxxACUr/doagofGT7LLg='
WHERE
key_id = '78f35c4bd60089a523ae563dcb708dc874a590238a8e2b9c68a3d081151be3dc'
AND (
token = 'zBplZx3FzdUjtJM9s+b7LUVqxxACUr/doagofGT7LLg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)