UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pBv6bkKdz0KPDtj05n4yI5I++VAmi9gQqWbYF5JxOnQ='
WHERE
key_id = '790f331675049f83bce68aa20f3812349c85ca37fea622f89fef97ad4f543c67'
AND (
token = 'pBv6bkKdz0KPDtj05n4yI5I++VAmi9gQqWbYF5JxOnQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)