UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rNzoR7b/DFEYs/FDwJIP3Ew4byqPFVX0eF0P116fQwM='
WHERE
key_id = 'faafc1ff574c545878945d8737b63cf63e9b04e680c76ec93432927f6629f662'
AND (
token = 'rNzoR7b/DFEYs/FDwJIP3Ew4byqPFVX0eF0P116fQwM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)