UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cn0318Btd7MetiQYNm40/NK2pf9E1tB3keEGXiM5//A='
WHERE
key_id = '91d7883652ba261c9329bc2d3648b0f6d1b071bf75cd5bd6cdac1001acda8bda'
AND (
token = 'Cn0318Btd7MetiQYNm40/NK2pf9E1tB3keEGXiM5//A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)