UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BKu/8ZNbsfK8Dq2DHJH6W43UKrmTOZzgnGoNN877uIs='
WHERE
key_id = '4f7af153431ada6121badc51f2253c015cac0210ad18ab1d7c42758c09e04386'
AND (
token = 'BKu/8ZNbsfK8Dq2DHJH6W43UKrmTOZzgnGoNN877uIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)