UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D+LFtDRtPTSlYQqE4EaW33ZSrWMKeeS6dNyJUz6mb5Y='
WHERE
key_id = '155a5a91caef1c78930d211c8df988976b6a6983bbd7134a3fcfeae7527dae44'
AND (
token = 'D+LFtDRtPTSlYQqE4EaW33ZSrWMKeeS6dNyJUz6mb5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)