UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CmDWyYl5utZ9ZbENXWXmPlO61gTu8QG9idhahRAcF+s='
WHERE
key_id = '09646f403e7e0266596d2a4fe272bd95c00f7a0d5647848a204fd7c2ea6ffa82'
AND (
token = 'CmDWyYl5utZ9ZbENXWXmPlO61gTu8QG9idhahRAcF+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)