UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TDlU53CLUA6bQtxuJPANC3aj2hGExq/07z7TUaO1p00='
WHERE
key_id = '93f4354e57b2753bd36c3d59f230354597ee9c410e87128160f8626ee38d0fef'
AND (
token = 'TDlU53CLUA6bQtxuJPANC3aj2hGExq/07z7TUaO1p00='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)