UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B2h4TTSp5NWO3Nj2Y9rkDONxK7QtMDiSvo2ybmdb0ic='
WHERE
key_id = '5c09c842b78b2b65dfaf25a56a8c00e5eb704c8b0ee933f41282ae87f07063a0'
AND (
token = 'B2h4TTSp5NWO3Nj2Y9rkDONxK7QtMDiSvo2ybmdb0ic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)