UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U3byeomOn/N1PCHY/kZ+yZ+2TpT6Rd91VQ3BuNspF40='
WHERE
key_id = 'c06cfb7d479b698eb667cc9fbb7f2b07471acfd3d2ab2a980a2737cd56cd0d86'
AND (
token = 'U3byeomOn/N1PCHY/kZ+yZ+2TpT6Rd91VQ3BuNspF40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)