UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'njgY2YXCAZ/TlwBAoBIn2r4p4dHBcIEOlkCUa0T0I7w='
WHERE
key_id = '60c9f419693584c9f0ff74dc58e856a2d024868221144f68fbde0587fce07076'
AND (
token = 'njgY2YXCAZ/TlwBAoBIn2r4p4dHBcIEOlkCUa0T0I7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)