UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bo5mLVwkH1vm/DNiJ2pUVkc8wcKbMt4UJc5Sm6Fty1I='
WHERE
key_id = 'ba78e502690fec354f5aecbc8652eaa164e38e0c8666c46fcc3d5114d4a5dbd9'
AND (
token = 'bo5mLVwkH1vm/DNiJ2pUVkc8wcKbMt4UJc5Sm6Fty1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)