UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N2lsaBueEz5mhi/1WdFQCyWoCGeEFQxkKjMvWaHfH/o='
WHERE
key_id = '33f331d3d358e291d9c939fdcd676bdc08d94c017e147adca583756bde74f27c'
AND (
token = 'N2lsaBueEz5mhi/1WdFQCyWoCGeEFQxkKjMvWaHfH/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)