UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zdM2/08zLlLea3aT7TZz/AxU4WzrnD8WxKHyWHG04+8='
WHERE
key_id = '3ab8b1f1c14f8cbe63769e895b7f2b8c044d67f8a8b3636b53c5d30f7eaef1c3'
AND (
token = 'zdM2/08zLlLea3aT7TZz/AxU4WzrnD8WxKHyWHG04+8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)