UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NaoM4ZjHxcxffnTK833wAJt/Oku5UTI6W81E0UL0uE0='
WHERE
key_id = '34de76779f7679758252753069d5cb306500d89fcf66e51d2ca14cc9a06f2e08'
AND (
token = 'NaoM4ZjHxcxffnTK833wAJt/Oku5UTI6W81E0UL0uE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)