UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Wsr8B1osUe4DJGSVOvWpkvCiTy9Od4RUYq4Nn5na7I='
WHERE
key_id = '5b2fc7475a4e102b699250fe8f362673e75946db652fb5a4266dc936c7fab341'
AND (
token = '6Wsr8B1osUe4DJGSVOvWpkvCiTy9Od4RUYq4Nn5na7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)