UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zd63HWu/fLl1KGX8e9b8Dsm9FL/Yyt8PYTiMnkJEQuM='
WHERE
key_id = '1e7fc1ee7831d19678b5fadc8d75ad4aefa9b0d2a35067607f15102fa225b838'
AND (
token = 'zd63HWu/fLl1KGX8e9b8Dsm9FL/Yyt8PYTiMnkJEQuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)