UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SdCW/5MgDMBaBkAta4YwUy2VMjz3+sDCLkFukwJA5Sc='
WHERE
key_id = '7221391081e63b716906aee51db2f2f0c2d4b7788ed08112e7569d06ca8bc3b5'
AND (
token = 'SdCW/5MgDMBaBkAta4YwUy2VMjz3+sDCLkFukwJA5Sc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)