UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GP2BpdZ/9MkDADsTfRS2AOYD3yBjys5u4xJdkvrACqA='
WHERE
key_id = '782f2f12d2947fea4e35ea24efb1c5405f1df77ae5d855d66fa7a8de2f8d4a40'
AND (
token = 'GP2BpdZ/9MkDADsTfRS2AOYD3yBjys5u4xJdkvrACqA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)