UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mxg7QOpubZpcJWqX7o2iZkEG/33AJPzxZIHoYzhKn2Q='
WHERE
key_id = 'fec8079980f757f131ecb0d47725995db246e12f9d00de540603ccad5733a427'
AND (
token = 'Mxg7QOpubZpcJWqX7o2iZkEG/33AJPzxZIHoYzhKn2Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)