UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bGwebBJ764FzaAAzLhHwJnyB6qkFSYFxReqNbWKTNJs='
WHERE
key_id = '07d592a9ae7520c555091630127271fcddd06f6d3568915906075ecb20e549ae'
AND (
token = 'bGwebBJ764FzaAAzLhHwJnyB6qkFSYFxReqNbWKTNJs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)