UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oWVQkf8xpjndqsaBk2XDUUEgLod2njuzb+23ZhP49u4='
WHERE
key_id = '4abc2a8e1d672fa55d4cbd9bf8be21c2d88a38b1db7f3b8d9105fb281c47b868'
AND (
token = 'oWVQkf8xpjndqsaBk2XDUUEgLod2njuzb+23ZhP49u4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)