UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vIh2gg7KabCe/nW7jdb+AfKgCYcj4wzlQkFIhyMOkAA='
WHERE
key_id = '2b9cd782aa1a1ff0574d1292a5f0240e9c453842ab46763443d14c5525a6aa28'
AND (
token = 'vIh2gg7KabCe/nW7jdb+AfKgCYcj4wzlQkFIhyMOkAA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)