UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jcvvg2X9Sq6iGhgYlRQwjkvI+i4Dr/2pmVmt/U1o8X0='
WHERE
key_id = '7b6250dff9e6ef37de390ee8768a5f819bbfc34abc5a8a337de9d0df9988048c'
AND (
token = 'Jcvvg2X9Sq6iGhgYlRQwjkvI+i4Dr/2pmVmt/U1o8X0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)