UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PTFX/+Pxu172pJUnY+p6yWqBB7kTjkcuN8y2wrtLwUM='
WHERE
key_id = 'e690c1b783e05058c48c1fee89f7370152b8ad31460c170ca1cc780ae5fcfa2d'
AND (
token = 'PTFX/+Pxu172pJUnY+p6yWqBB7kTjkcuN8y2wrtLwUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)