UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yD4naw7ZLNsAfEnU1UVAEI2uTCsdbD5zqZXbF2sJqrs='
WHERE
key_id = 'dc81ff743d33764f3884ae873063bf4059a51a6646285d621aa02b949560cf13'
AND (
token = 'yD4naw7ZLNsAfEnU1UVAEI2uTCsdbD5zqZXbF2sJqrs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)